home *** CD-ROM | disk | FTP | other *** search
- Path: oxy.rust.net!usenet
- From: ebennett@rust.net
- Newsgroups: comp.lang.c
- Subject: Re: Constructor?
- Date: Sun, 14 Jan 1996 01:06:36 GMT
- Organization: Rust Net - High Speed Internet in Detroit 810-642-2276
- Message-ID: <4d9abg$pj1@oxy.rust.net>
- References: <00001a80+00006b6c@msn.com>
- NNTP-Posting-Host: liv-20.rust.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- Pacu@msn.com (kenneth long) wrote:
-
- >In a program example, I saw something similar to the following:
-
- > public:
- > CString str;
- > (etc..)
-
-
- > Later, in a function, I saw:
-
- > Function()
- >
- > Cstring str;
- > (etc..)
-
- >In episode one, is it declaring str to be of CString type or is it
- >constructed there?
-
- In the first case, str is being declared as a variable of type
- CString. It will be constructed when the constructor for the class in
- which it is declared is executed.
-
- >And in the second instance, inside of the
- >function, is it being constructed or is it a variable of CString
- >type? If this example is too vague, I will try to find the missing
- >pieces, but I ask it in a general sense concerning the nature of
- >constuctors and variable tpe declaration.
-
- In the second case, a variable of type CString is being declared _and
- constructed_. The constructor will execute when this statement is
- reached.
-
- Earl
-
-
-